﻿<%@ Page Language="C#" MasterPageFile="~/LTR/MlyLtrMaster.Master" AutoEventWireup="true"
    CodeBehind="ClienteditWoForm.aspx.cs" Inherits="MLY.LTR.Clients.ClienteditWoForm" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="titleHolder" runat="server">
    <style type="text/css">
        </style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ForeColor="Red" Font-Bold="true" ID="errMsg" runat="server"></asp:Label>
    <asp:Panel runat="server" ID="successMsg" Visible="false">
        <asp:Label ForeColor="Green" Font-Bold="true" Text='<%$Dict:clientEditWo.ItemEditSuccess%>'
            runat="server"></asp:Label>
        <asp:LinkButton runat="server" ID="goBackBtn" OnClick="goBackBtn_Click">
            <asp:Literal ID="Literal2" runat="server" Text="<%$Dict:ClienteditWoForm.goBack%>" /></asp:LinkButton></asp:Panel><asp:FormView 
        ID="FormView1" runat="server" DataKeyNames="WorkOrderId" DataSourceID="LinqDataSource1"
        DefaultMode="Edit" Width="100%" CssClass="blueTxtBox" 
        OnItemUpdating="FormView1_ItemUpdating"><EditItemTemplate>
            <asp:HiddenField runat="server" ID="workOrderIdHidden" Value='<%# Bind("WorkOrderId") %>' />
            <asp:Panel ID="Panel1" runat="server">
                <table style="width: 100%;">
                    <tr>
                        <td>
                            <asp:Literal ID="Literal4" runat="server" Text="<%$Dict:ClienteditWoForm.ContractorId%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox20" runat="server" Enabled="false" Text='<%# Bind("ContractorId") %>' />
                        </td>
                        <td style="width: 300px;">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal2" runat="server" Text="<%$Dict:ClienteditWoForm.clientWoNum%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="CustomerWorkOrderNumberTextBox" runat="server" Text='<%# Bind("CustomerWorkOrderNumber") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal21" runat="server" Text="<%$Dict:ClienteditWoForm.contractorWoNum%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ContractorWorkOrderNumber") %>'
                                Enabled="false" />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal23" runat="server" Text="<%$Dict:ClienteditWoForm.ContractorLotNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ContractorLotNumber") %>' />
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal24" runat="server" Text="<%$Dict:ClienteditWoForm.SendDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="SendDateTextBox" runat="server" Text='<%# Bind("SendDate","{0:dd/MM/yyyy}") %>' />
                        </td>
                        <td>
                            <KBMValidators:PastOnlyDateValidator ControlToValidate="SendDateTextBox" runat="server"
                                ID="pastOnlyValidator"></KBMValidators:PastOnlyDateValidator><KBMControls:KbmCalendar
                                    TargetControlID="SendDateTextBox" runat="server" ID="sendDateValidator">
                                </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal25" runat="server" Text="<%$Dict:ClienteditWoForm.RequestedDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="RequestedDelivaryDateTextBox" runat="server" Text='<%# Bind("RequestedDelivaryDate","{0:dd/MM/yyyy}") %>' />
                            <KBMControls:KbmCalendar TargetControlID="RequestedDelivaryDateTextBox" runat="server"
                                ID="KbmCalendar2">
                            </KBMControls:KbmCalendar>
                        </td>
                        <td>
                            <KBMValidators:BiggerThenEqualDateValidator runat="server" ID="CompareValidator1"
                                ControlToValidate="RequestedDelivaryDateTextBox" ControlToCompare="SendDateTextBox">
              
                            </KBMValidators:BiggerThenEqualDateValidator></td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal26" runat="server" Text="<%$Dict:ClienteditWoForm.PlannedDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtPlannedDelivaryDate" runat="server" Enabled="false" Text='<%# Bind("PlannedDelivaryDate","{0:dd/MM/yyyy}") %>' />
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal27" runat="server" Text="<%$Dict:ClienteditWoForm.ActualDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("ActualDelivaryDate","{0:dd/MM/yyyy}") %>' />
                            <KBMValidators:PastOnlyDateValidator ID="futureValidator" ControlToValidate="TextBox8"
                                runat="server"></KBMValidators:PastOnlyDateValidator><KBMControls:KbmCalendar TargetControlID="TextBox8"
                                    runat="server" ID="KbmCalendar1">
                                </KBMControls:KbmCalendar>
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal28" runat="server" Text="<%$Dict:ClienteditWoForm.CustomerPriority%>" />
                        </td>
                        <td>
                            <uc:styledUpDown DoubleDigit="true" runat="server" Text='<%# Bind("CustomerPriority") %>'
                                isRequired="true" ID="StyledUpDown1" />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal30" runat="server" Text="<%$Dict:ClienteditWoForm.Quantity%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox2" runat="server" Enabled="false" Text='<%# Bind("Quantity") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal5" runat="server" Text="<%$Dict:ClienteditWoForm.QuantitySentForDist%>" />
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="quantSentTxt" />
                            <KBMValidators:numericValidator ID="NumericValidator1" ControlToValidate="quantSentTxt"
                                runat="server"></KBMValidators:numericValidator></td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal31" runat="server" Text="<%$Dict:ClienteditWoForm.CustomerCatalougeCode%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="CustomerCatalougeCodeTextBox" runat="server" Text='<%# Bind("CustomerCatalougeCode") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal1" runat="server" Text="<%$Dict:ClienteditWoForm.ContractorCatalougeCode%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox1" runat="server" Enabled="false" Text='<%# Bind("ContractorCatalogueCode") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal32" runat="server" Text="<%$Dict:ClienteditWoForm.ProductDescription%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("ProductDescription") %>' />
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal33" runat="server" Text="<%$Dict:ClienteditWoForm.TextFieldA%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("TextFieldA") %>' />
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal35" runat="server" Text="<%$Dict:ClienteditWoForm.TextFieldB%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("TextFieldB") %>' />
                        </td>
                        <td> &nbsp; </td> </tr><tr>
                            
                        <td>
                            <asp:Literal ID="Literal8" runat="server" Text="<%$Dict:TextFieldC%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("TextFieldC") %>' />
                        </td>
                        <td> &nbsp; </td> </tr><tr>
                            
                        <td>
                            <asp:Literal ID="Literal36" runat="server" Text="<%$Dict:ClienteditWoForm.Remarks%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("Remarks") %>' />
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal37" runat="server" Text="<%$Dict:ClienteditWoForm.OrderNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("OrderNumber") %>' />
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal6" runat="server" Text="<%$Dict:ClienteditWoForm.DateFieldA%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDateFieldA" runat="server" Text='<%# Bind("DateFieldA","{0:dd/MM/yyyy}") %>' />
                            <KBMValidators:DateValidator ID="DateValidator1" ControlToValidate="txtDateFieldA"
                                runat="server" />
                            <KBMControls:KbmCalendar TargetControlID="txtDateFieldA" runat="server" ID="KbmCalendar3">
                            </KBMControls:KbmCalendar>
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal7" runat="server" Text="<%$Dict:ClienteditWoForm.DateFieldB%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDateFieldB" runat="server" Text='<%# Bind("DateFieldB","{0:dd/MM/yyyy}") %>' />
                            <KBMValidators:DateValidator ID="DateValidator2" ControlToValidate="txtDateFieldB"
                                runat="server" />
                            <KBMControls:KbmCalendar TargetControlID="txtDateFieldB" runat="server" ID="KbmCalendar4">
                            </KBMControls:KbmCalendar>
                        </td>
                        <td>
                            &nbsp; </td></tr><tr>
                        <td>
                            <asp:Literal ID="Literal3" runat="server" Text="<%$Dict:ClienteditWoForm.WatchAttachments%>" />
                        </td>
                        <td>
                            <asp:ImageButton CausesValidation="false" ID="AttachMentImageButton" runat="server"
                                PostBackUrl="<%# String.Format(&quot;~/LTR/AttachmentManager.aspx?woId={0}&quot;,Eval(&quot;WorkOrderId&quot;))  %>"
                                Width="20" OnClick="AttachClicked" CommandName="Attach" ImageUrl="~/Images/attachment-icon.png" />
                        </td>
                    </tr>
                </table>
                <table class="bottomBtnsCls" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 82px;">
                            <asp:ImageButton ID="btnClose" align="middle" Width="13" Height="13" runat="server"
                                ImageUrl="~/Images/add_wo/close_icon.png" CausesValidation="false" PostBackUrl='<%# ViewState["Referer"] != null ? ViewState["Referer"].ToString() : "" %>' />&nbsp <asp:Literal ID="Literal20" runat="server" Text='<%$Dict:ClienteditWoForm.Close %>' />
                        </td>
                        <td>
                            <asp:ImageButton ID="btnSave" align="middle" runat="server" Width="13" Height="13"
                                CommandName="Update" ImageUrl="~/Images/add_wo/save_icon.png" CausesValidation="true" />
                            &nbsp <asp:Literal ID="Litearl1" runat="server" Text='<%$Dict:ClienteditWoForm.Save %>' />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </EditItemTemplate>
    </asp:FormView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="MLY.Dal.lqKbmDataContext"
        EnableUpdate="True" TableName="TableWorkOrders" Where="WorkOrderId == @WorkOrderId"
        OnUpdated="LinqDataSource1_Updated">
        <WhereParameters>
            <asp:QueryStringParameter DefaultValue="-1" Name="WorkOrderId" QueryStringField="Edit"
                Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
